%% AsciiConv.tex - ASCII conversion chapter
%% Created by Robert Heller on Thu Mar 12 17:56:10 1992
%%
%% ------------------------------------------------------------------
%% Home Libarian by Deepwoods Software
%% ------------------------------------------------------------------
%% Modification History:
%% ------------------------------------------------------------------
%% Contents:
%% ------------------------------------------------------------------
%% 
%% 
%% Copyright (c) 1991,1992 by Robert heller (D/B/A Deepwoods Software)
%%        All Rights Reserved
%% 
%%
\chapter{Converting to and from Text Files.}
\label{AsciiConv}

\newcommand{\AsciiLibr}{{\tt Ascii2Libr}}
\newcommand{\LibrAscii}{{\tt Libr2Ascii}}

The \LibrAscii\ program converts a data base file to a portable ASCII
text file.  The \AsciiLibr\ takes the ASCII text file generated by
\LibrAscii\ and re-creates the data base file.  These programs are meant
for converting the data base files to a form that can be readily
transfered between different systems.  The data base files themselves
use internal (CPU dependent) representation of the data stored, to allow
rapid accessing and processing of the data.  Another thing these
programs do is to ``compress'' data base files, by discarding deleted
and inaccessable data.

\section{Invoking \LibrAscii.}

\LibrAscii\ is invoked from the command line like this:
\begin{verbatim}

Libr2Ascii -infile <filename>

\end{verbatim}
Where \verb+<filename>+ is the name of the file to be converted.  The
output is sent to the standard output stream, where it can be redirected
or piped to other processing.  This output is a plain text file.

\section{Invoking \AsciiLibr.}

\AsciiLibr\ is invoked from the command line like this:
\begin{verbatim}

Ascii2Libr -outfile <filename>

\end{verbatim}
or like this to specify a new minimum page count:
\begin{verbatim}

Ascii2Libr -outfile <filename> -minpages <minpages>

\end{verbatim}
Where \verb+<filename>+ is the name of the file to be created and
\verb+<minpages>+\index{card catalog db@{\bf card catalog db}!index pages in}
is the (optional) minimum number of index pages to 
allocate\footnote{If {\tt \char'074 minpages\char'076} is not specified,
the number of index pages to pre-allocate is taken from the input stream
and is just enough to hold the indices.}.

The input to \AsciiLibr\ is from the standard input stream.

\section{When You Need to Use These Programs.}

These programs convert a binary format card catalog data base file to an
easily transferable text 
file.\index{card catalog db@{\bf card catalog db}!converting to text}
All modern computer systems support
plain ASCII text files.  The binary format contains processor-dependent
binary representations of the values use.

These two programs can also be used to
``compress''\index{card catalog db@{\bf card catalog db}!compressing}
a data base file.  \EditLibr\ makes no attempt to re-cycle data
records.  This is due in part because these records are variable
length. Maintaining a table of ``deleted'' records, along with their
sizes would involve considerable overhead.  It is simpler to waste some
disk space during the editing process and reclaim it later with
\LibrAscii\ and \AsciiLibr.  

